<?php
//在其他页面做引用：
//include "pwd_session.php";
header("content-type:text/html;charset=utf-8");
session_start();
if(!$_SESSION['dpwd']){
$selfFile=substr($_SERVER['PHP_SELF'], strrpos($_SERVER['PHP_SELF'], '/')+1);
$zm='lyesswlqbj';
$arrnum=array('37575451','37575451','195956535','91515457','735356595','37575859','91515253','195958575','735352515','37575451');
$now=date('Y-m-d H:i:s');
$i=substr($now, -2,1);
$s=substr($now, -1,1);
$mm=$zm{$i}.$zm{$s}.$arrnum[$s];
$nowt=$_SESSION['now']?$_SESSION['now']:$now;
//echo $_SESSION['mm'];
if(!$_SESSION['mm']){
	$_SESSION['mm']=$mm;
	$_SESSION['now']=$now;
}
if($_POST['dpwd']==$_SESSION['mm']){
	$_SESSION['dpwd'] = 'dpwd';
	echo "<script>window.location.href='".$selfFile."'</script>";
}elseif($_POST['dpwd']&&($_POST['dpwd']!=$_SESSION['mm'])){
	echo "<script>";
	echo "alert('错啦 ~_~！');";
	echo "window.location.href='".$selfFile."';";
	echo "</script>";
}
?>
<html>
	<head>
		<meta charset="UTF-8">
		<style type="text/css">
*{margin: 0;}
.bai{
	width: 100%;
	height: 100%;
	background-color: white;
	position: absolute;
	z-index: 5;
	/*display: none;*/
}
#btn{
	cursor: default;
	color: white;
}
		</style>
	</head>
	<body>
<div class="bai" id="bai"><span id="btn">hidden</span></div>
<p>现在时间：<span id="showtime" ></span></p>
<script type="text/javascript">
	var btn=document.getElementById('btn');
	var tag = 1;
	var dpwd="<?php echo $_SESSION['dpwd']; ?>" ? "<?php echo $_SESSION['dpwd']; ?>" : 'none';
	if(dpwd=='dpwd'){
		bai.style.display="none";
	}
	btn.onclick = function(){
		var bai=document.getElementById('bai');
	    if (tag == 1) {
	        tag++;
	    }else if(tag==6){
	        alert(tag);
	        bai.style.display="none";
	        tag++;
	    }else if(tag==999){
	    	alert('999');
	    	tag=1;
	    }else{
	    	tag++;
	    }
	}
	function getDate(){
		var date=new Date();
		var year=date.getFullYear();
		var month=date.getMonth()+1;
		var day=date.getDate();
		var weeks=["日","一","二","三","四","五","六"];
		var week=date.getDay();
		var hours=date.getHours();
		var min=date.getMinutes();
		var sec=date.getSeconds();
		var str =year+"-"+month+"-"+day+" 星期"+weeks[week]+" "+hours+":"+min+":"+sec;
		document.getElementById("showtime").innerHTML=str;
	}
	setInterval("getDate()",1000);
</script>
	</body>
</html>
<?php
echo "访问时刻：".$nowt."</br>";
echo "提示码：".mt_rand(100000, 999999);
echo "<form action='".$selfFile."' method='post'>
		<input type='text' name='dpwd' value='' />
		<input type='submit' value='提交'/>
	</form>";
exit();
}
?>